package com.yy.wga.common.core.enmus;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author lgw
 * @version JDK 8
 * @date 2025/3/28
 * @description 上架，下架
 */
@AllArgsConstructor
@Getter
public enum UpOrDownType {
    UP(1, "上架"),
    DOWN(2, "下架"),
    ;

    private final Integer type;
    private final String desc;

    /**
     * 上架，下架枚举
     *
     * @param type 类型
     * @return
     */
    public static UpOrDownType getByType(Integer type) {
        if (type != null) {
            for (UpOrDownType upOrDownType : UpOrDownType.values()) {
                if (upOrDownType.getType().equals(type)) {
                    return upOrDownType;
                }
            }
        }
        return null;
    }
}
